window.onload=function(){
    let option=document.getElementsByClassName("option");
    let show=document.getElementsByClassName("show");
    let favorite=document.getElementsByClassName("favorite");
    let itemshowbox=document.getElementsByClassName("item-show-box");
    for(let i=0;i<option.length;i++){
        option[i].addEventListener("click",()=>{
            for(let n=0;n<option.length;n++){
                if(n==i){
                    option[n].setAttribute("class","option checked");
                    show[n].setAttribute("class","show now");
                }else{
                    option[n].setAttribute("class","option");
                    show[n].setAttribute("class","show");
                }
            }
        })
    }
    for(let i=0;i<favorite.length;i++){
        favorite[i].addEventListener("click",()=>{
            for(let n=0;n<favorite.length;n++){
                if(n==i){
                    favorite[n].setAttribute("class","favorite checked");
                    itemshowbox[n].setAttribute("class","item-show-box select");
                }else{
                    favorite[n].setAttribute("class","favorite");
                    itemshowbox[n].setAttribute("class","item-show-box");
                }
            }
        })
    }

}
